package handler

import (
	"github.com/gin-gonic/gin"
)

func Router(handlers ...ApiHandler) *gin.Engine {
	router := gin.Default()
	// 中间件统一注册
	router.Use(gin.Logger())
	router.Use(gin.Recovery())

	for _, h := range handlers {
		h.RegisterRoutes(router)
	}

	return router
}
